#ifndef GUI_TOOL_HPP
#define GUI_TOOL_HPP

#include <string>
#include <SFML/System.hpp>

#include "buildable.h"

class City;

class GuiTool
{
public:
  GuiTool();
  virtual ~GuiTool(){;}

  virtual void onUse(sf::Vector2i coords) const = 0;

  GuiTool& setImagePath(std::string path)
  {
    m_imagePath = path;
    return *this;
  }

  const std::string& getImagePath() const
  {
    return m_imagePath;
  }

private:
  std::string m_imagePath;
};

class BuildableTool : public GuiTool
{
public:
  BuildableTool(City& city)
    : m_city(city)
  {
  }

  void onUse(sf::Vector2i coords) const;

  BuildableTool& setType(Buildable::Type type)
  {
    m_type = type;
    return *this;
  }

  BuildableTool& setDensity(Buildable::Density density)
  {
    m_density = density;
    return *this;
  }

private:
  Buildable::Type m_type;
  Buildable::Density m_density;

  City& m_city;
};

class BulldozerTool : public GuiTool
{
public:
  BulldozerTool(City& city)
    : m_city(city)
  {
  }

  void onUse(sf::Vector2i coords) const;

private:
  City& m_city;
};

#endif